const EventNames = [
    'API:UN_AUTH',
    'API:VALIDATE_ERROR',
    'API_ERROR'
]

class EventEmitter {
    _listeners = {
        'API:UN_AUTH': new Set(),
        'API:VALIDATE_ERROR': new Set(),
        'API_ERROR': new Set(),
    }

    on(eventName, listener) {
        this._listeners[eventName].add(listener)
    }
    emit(eventName, ...args) {
        this._listeners[eventName].forEach(listener => listener(...args))
    }
}


export default new EventEmitter()
